<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : serverFile.xsl
    Created on : 19 de marzo de 2010, 11:38
    Author     : fherher
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"
                xmlns:tns="http://xml.netbeans.org/schema/schemaServerFile"
                />

    <!-- TODO customize transformation rules
         syntax recommendation http://www.w3.org/TR/xslt
    -->
    <xsl:template match="/">
        <html>
            <head>
                <title>News and last versions</title>
            </head>
            <body>
                <table border="0" cellpadding="5" cellspacing="1">
                    <tr bgcolor="LightBlue">
                        <TH align="left">Filename</TH>
                        <TH align="left">News</TH>
                        <TH align="left">Date</TH>
                        <TH align="left">Version</TH>
                        <TH align="left">Size</TH>
                    </tr>
                    <xsl:for-each select="//file">
                        <tr bgcolor="lightgrey">
                            <td>
                                <xsl:element name="a">
                                    <xsl:attribute name="href">
                                        <xsl:value-of select="@url" />
                                    </xsl:attribute>
                                    <xsl:value-of select="@name" />
                                </xsl:element>
                            </td>
                            <td>
                                <xsl:for-each select="news">
                                    - <xsl:value-of select="."/><br/>
                                </xsl:for-each>
                            </td>
                            <td>
                                <xsl:value-of select="@date" />
                            </td>
                            <td>
                                <xsl:value-of select="@version" />
                            </td>
                            <td>
                                <xsl:value-of select="@size" />
                            </td>
                        </tr>
                    </xsl:for-each>
                </table>
                <table border="0" bgcolor="gainsboro">
                    <tr bgcolor="burlywood">
                        <TH Align="left">General news:</TH>
                    </tr>
                    <xsl:for-each select="*/news">
                        <tr>
                            <td>
                                <xsl:value-of select="."/>
                            </td>
                        </tr>
                    </xsl:for-each>
                </table>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>
